import request from '@/utils/request'

// List channels
export function listChannel(query:any) {
  return request({
    url: '/tienchin/channel/list',
    method: 'get',
    params: query
  })
}

// Get channel details by ID
export function getChannel(channelId:any) {
  return request({
    url: '/tienchin/channel/' + channelId,
    method: 'get'
  })
}

// Add new channel
export function addChannel(data:any) {
  return request({
    url: '/tienchin/channel',
    method: 'post',
    data: data
  })
}

// Update channel
export function updateChannel(data:any) {
  return request({
    url: '/tienchin/channel',
    method: 'put',
    data: data
  })
}

// Delete channel
export function delChannel(channelId:any) {
  return request({
    url: '/tienchin/channel/' + channelId,
    method: 'delete'
  })
}

// Export channel data
export function exportChannel(query:any) {
  return request({
    url: '/tienchin/channel/export',
    method: 'get',
    params: query
  })
}
